-
Notifications
You must be signed in to change notification settings - Fork 750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SYCL] Refactor sycl::vec
's operators implementation
#16529
Conversation
4dee791
to
59e673d
Compare
* Don't use `sycl::vec::vector_t`, as it is planned to be removed from the SYCL 2020 (KhronosGroup/SYCL-Docs#676). Note that this implementation is NOT required to use it, so this PR can be merged before the specification change. * Use `ext_vector_type`-based optimized implementation whenever it's available and not on device only.
59e673d
to
0b224e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Do you think it would be worth it to also add a test to check the LLVM IR generated on host, with and without this optimization? Something similar to check_device_code/vector/vector_math_ops.cpp
?
I don't see any benefits in that. It's either exactly the same as for device, or old naive implementation, depending on the host compiler. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM!
This reverts commit 16c2c21.
Reverts #16529 due to failure to build on Windows and MacOS in post-commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to revert this patch due to failures in post-commit builds on Windows and MacOS.
// `std::array<bool, N>` is different and LLVM annotates its | ||
// elements with [0, 2) range metadata when loaded, so we need to | ||
// ensure we generate 0/1 only (and not 2/-1/etc.). | ||
static_assert((ext_vector<int8_t, 2>{1, 0} == 0)[1] == -1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not seem to be a constant expression on Windows and MacOS.
* Don't use `sycl::vec::vector_t`, as it is planned to be removed from the SYCL 2020 (KhronosGroup/SYCL-Docs#676). Note that this implementation is NOT required to use it, so this PR can be merged before the specification change. * Use `ext_vector_type`-based optimized implementation whenever it's available and not on device only. This is a recommit of intel#16529 with an additional `#if __clang_major__ >= 20` guard around `static_assert` on the expression that wasn't constant in clang-19.
* Don't use `sycl::vec::vector_t`, as it is planned to be removed from the SYCL 2020 (KhronosGroup/SYCL-Docs#676). Note that this implementation is NOT required to use it, so this PR can be merged before the specification change. * Use `ext_vector_type`-based optimized implementation whenever it's available and not on device only. This is a recommit of #16529 with an additional `#if __clang_major__ >= 20` guard around `static_assert` on the expression that wasn't constant in clang-19.
sycl::vec::vector_t
, as it is planned to be removed from the SYCL 2020 (Remove underspecified vector_t KhronosGroup/SYCL-Docs#676). Note that this implementation is NOT required to use it, so this PR can be merged before the specification change.ext_vector_type
-based optimized implementation whenever it's available and not on device only.